package com.qiudaozhang.loveblog.config;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.mongodb.MongoDbFactory;
import org.springframework.data.mongodb.MongoTransactionManager;
import org.springframework.http.client.SimpleClientHttpRequestFactory;
import org.springframework.web.client.RestTemplate;

/**
 * @author 邱道长
 * 2019/11/13
 */
@Configuration
public class AppConfig {


    @Bean
    public RestTemplate restTemplate(){
        RestTemplate restTemplate = new RestTemplate();
        return restTemplate;
    }

//
//    @Bean
//    @ConditionalOnProperty(name="spring.data.mongodb.transactionEnabled",havingValue = "true")
//    MongoTransactionManager transactionManager(MongoDbFactory factory){
//        return new MongoTransactionManager(factory);
//    }

}
